﻿using BW.WMS.WareHouseAllot.Dto.DocCode;
using BW.WMS.WareHouseAllot.Parameter.Input.Doccode;
using BW.WMS.WareHouseAllot.Parameter.Output.Doccode;
using BW.WMS.WareHouseAllot.Parameter.Output.GoodsType;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;

namespace BW.WMS.WareHouseAllot.Interface.Doccode
{
    /// <summary>
    /// 自动生成编码服务接口
    /// </summary>
    public interface IDoccodeService
    {
        /// <summary>
        /// 添加编码规则
        /// </summary>
        Task<DoccodeDto> AddDoccodeAsync(AddDoccodeInput input);

        /// <summary>
        /// 更新编码规则
        /// </summary>
        Task<DoccodeDto> UpdateDoccodeAsync(Guid id, UpdateDoccodeInput input);

        /// <summary>
        /// 获取编码规则列表
        /// </summary>
        Task<PagedResultDto<DoccodeOutput>> GetDoccodeAsync();

        /// <summary>
        /// 删除编码规则
        /// </summary>
        Task DeleteDoccodeAsync(Guid id);

        /// <summary>
        /// 【新增】根据业务名称自动生成编码
        /// </summary>
        /// <param name="serviceName">业务名称</param>
        /// <returns>生成的编码</returns>
        Task<string> GenerateCodeAsync(string serviceName);

        /// <summary>
        /// 【新增】预览编码（不影响流水号）
        /// </summary>
        /// <param name="input">编码规则</param>
        /// <returns>预览编码</returns>
        //Task<string> PreviewCodeAsync(AddDoccodeInput input);

        /// <summary>
        /// 【新增】获取所有业务名称（用于前端下拉框）
        /// </summary>
        /// <returns>业务名称列表</returns>
        Task<List<string>> GetServiceNamesAsync();

        /// <summary>
        /// 根据业务名称获取单据字段列表
        /// </summary>
        Task<List<FieldOptionDto>> GetFieldOptionsByServiceNameAsync(string serviceName);

    }
}